package com.gen.tool;

import android.app.AlertDialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
//import android.view.Window;
//import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

import com.ouken.com.R;

public class AlertDialog_ok{
	private Context context;
	private String msg;
	
	private LayoutInflater factory;
	final View show_ok;
	private Button confirm_btn_ok;
	private TextView text_ok;
	private AlertDialog alertDialog;
	
	public AlertDialog_ok(Context context,String msg) {
		super();
		this.context = context;
		this.msg = msg;
		
		this.factory = LayoutInflater.from(context); 
		this.show_ok = factory.inflate(R.layout.alert_dialog_ok, null);
		this.confirm_btn_ok = (Button) show_ok.findViewById(R.id.alerDialog_ok_con_btn);
		this.text_ok =   (TextView) show_ok.findViewById(R.id.alerDialog_ok_tv);
		
	}
	
	public AlertDialog AlertDialog_ok_show(){
		this.text_ok.setText(msg);
		this.text_ok.setTextSize(18.0f);
		this.alertDialog = new AlertDialog.Builder(this.context).create();
		
		/*Window window = alertDialog.getWindow();
		WindowManager.LayoutParams lp = window.getAttributes();
		lp.alpha = 1f;  
	    window.setAttributes(lp); */
		alertDialog.setCancelable(false);
	    alertDialog.show();
	    alertDialog.setContentView(show_ok);
	    
	    return this.alertDialog;
	}
	
	public Button getConfirm_btn_ok() {
		return confirm_btn_ok;
	}

	public AlertDialog getAlertDialog() {
		return alertDialog;
	}

}